package hn.cch.mybatis.boot.mapper;

import hn.cch.mybatis.boot.entity.TableEntity;
import hn.cch.mybatis.boot.provider.ScriptProvider;
import hn.cch.mybatis.boot.provider.SourceProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface ScriptMapper {

    @SelectProvider(value = ScriptProvider.class, method = "execute")
    public String execute(@Param(value = "script") String script);


    @SelectProvider(value = ScriptProvider.class, method = "getCountFromTable")
    public Integer getCountFromTable(@Param(value = "tableName") String tableName,
                                     @Param(value = "dateField") String dateField,
                                     @Param(value = "dateValue") String dateValue);


    @SelectProvider(value = ScriptProvider.class, method = "getCountByDateRange")
    public Integer getCountByDateRange(@Param(value = "tableName") String tableName,
                                             @Param(value = "dateField") String dateField,
                                             @Param(value = "startDate") String startDate,
                                             @Param(value = "endDate") String endDate);


}
